// 点击试卷后的缩略信息
<template>
  <div id="msg">
    <div class="crumbs">
        <el-page-header @back="goBack" content="竞赛详情">
        </el-page-header>
    </div>
    <el-card class="box-card">
      <el-descriptions title="">
      <el-descriptions-item label="竞赛名称">{{examData.contestName}}</el-descriptions-item>
      <!-- <el-descriptions-item label="总分">总分</el-descriptions-item> -->
      <el-descriptions-item label="开始时间">{{examData.startTime}}</el-descriptions-item>
      <el-descriptions-item label="结束时间">{{examData.endTime}}</el-descriptions-item>
      
      <!-- <el-descriptions-item label="考生须知"><i @click="dialogVisible = true" class="el-icon-info">考生须知</i></el-descriptions-item> -->
  </el-descriptions>
  <el-button type="primary" style="margin-left: 40%;margin-top: 3%; margin-bottom: 3%;" @click="toAnswer()">开始答题</el-button>
  <p style="margin-top: 10px; margin-bottom: 10px;"></p>
  <i @click="dialogVisible = true" style="font-size: 10px;" class="el-icon-info">考生须知</i>
</el-card>
      
   
<el-card class="box-card">
      <el-collapse v-model="activeName" >
        <el-collapse-item class="header" name="0">
          <template slot="title" class="stitle" >
            <div class="title">
              <span>{{examData.source}}</span><i class="header-icon el-icon-info"></i>
              <span class="time">{{examData.time / 60}}分钟</span>
              <el-button type="primary" size="small">点击查看试题详情</el-button>
            </div>
          </template>
          <el-collapse class="inner">
            <el-collapse-item v-for="item in examData.questionNum">
              <template slot="title" name="1">
                <div class="titlei">{{item.type}}题 (共{{item.count}}题)</div>
              </template>
              <div class="contenti">
                <ul class="question" v-for="(list, index) in item.answerList" :key="index">
                  <li>题目编号：{{ list }}</li>
                </ul>
              </div>
            </el-collapse-item>
            
          </el-collapse>
        </el-collapse-item>

      </el-collapse>
    </el-card>
    <!--考生须知对话框-->
    <el-dialog
      title="考生须知"
      :visible.sync="dialogVisible"
      width="30%">
      <p>诚信考试！</p>
      <p>请勿作弊！</p>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">知道了</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false, //对话框属性
      activeName: '0',  //默认打开序号
      topicCount: [],//每种类型题目的总数
      score: [],  //每种类型分数的总数
      examData: { //考试信息
        // source: null,
        // totalScore: null,
      },
      topic: {  //试卷信息

      },
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    //初始化页面数据
    init() {
      console.log("-----------------")
      console.log(this.$route.query.row)
      this.examData=this.$route.query.row
    },
    toAnswer() {
      this.$router.push({path:"/answerContest",query:{info: this.examData}})
    },
    goBack(){
      this.$router.push('/dashboard')
    }
  }
}
</script>

<style scoped>
.bottom {
  .right{
    .el-button{
      color: #409EFF;
      border-color: #c6e2ff;
      background-color: #ecf5ff;
    }
  }
}
.box-card {
    width: 100%;
    margin-bottom: 2%;
    margin-top: 2%;
  }
.inner .contenti .question {
  margin-left: 40px;
  color: #9a9a9a;
  font-size: 14px;
}
.content .inner .titlei {
  margin-left: 20px;
  font-size: 16px;
  color: #88949b;
  font-weight: bold;
}
.content .title .time {
  font-size: 16px;
  margin-left: 420px;
  color: #999;
}
.content .stitle {
  background-color: #0195ff;
}
.content .title span {
  margin-right: 10px;
}
#msg .content .title {
  font-size: 20px;
  margin: 0px;
  display: flex;
  align-items: center;
}
.content {
  margin-top: 20px;
  background-color: #fff;
}
.wrapper .info {
  margin: 20px 0px 0px 20px;
  border-top: 1px solid #eee;
  padding: 20px 0px 10px 0px;
}
.wrapper .info a {
  color: #88949b;
  font-size: 14px;
}
.el-icon-info:hover {
  color: #0195ff;
  cursor: pointer;
}

.wrapper .info a:hover {
  color: #0195ff;
}
.wrapper .bottom .btn {
  cursor: pointer;
  padding: 5px 10px;
  border: 1px solid #88949b;
  border-radius: 4px;
}
.wrapper .bottom {
  display: flex;
  margin-left: 20px;
  color: #999;
  font-size: 14px;
  align-items: center;
}
.wrapper .bottom li {
  margin-right: 14px;
}
#msg {
  background-color: #eee;
  /* width: 1500px; */
  margin: 0 auto;
}
#msg .title {
  margin: 20px;
}
#msg .wrapper {
  background-color: #fff;
  padding: 10px;
}
.wrapper .top {
  display: flex;
  margin: 20px;
  align-items: center;
}
.wrapper .top .right {
  margin-left: auto;
}
.wrapper .top .example {
  color: #333;
  font-size: 22px;
  font-weight: 700;
}
.wrapper .top li i {
  margin-left: 20px;
  color: #88949b;
}
.wrapper .right .count {
  margin-right: 60%;
  color: #fff;
  padding: 4px 10px;
  background-color: #88949b;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  border: 1px solid #88949b;
}
.wrapper .right .score {
  position: absolute;
  left: 53px;
  top: -5px;
  padding: 1px 12px;
  font-size: 20px;
  color: #88949b;
  border: 1px dashed #88949b;
  border-left: none;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  font-weight: bold;
}

</style>
